package com.sunwayhorizo.health.hl7.persistent;

import com.sunwayhorizo.health.hl7.persistent.pk.RimCoreActPrtcptnsPK;
import java.io.*;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
//@TableGenerator(name = "Prtcptn_IdGenerator", table = "RIM_Id_Generator", pkColumnName = "pkColumn", valueColumnName = "valueColumn",pkColumnValue = "Prtcptn_Id")
@DiscriminatorColumn(name = "PARTITION_BY_CLASS", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("RimCoreActPrtcptns")
@Table(name = "RIM_CORE_ACT_PRTCPTNS")
@IdClass(RimCoreActPrtcptnsPK.class)
public class RimCoreActPrtcptns implements Serializable {
    @Id
//    @GeneratedValue(strategy = GenerationType.TABLE, generator = "Prtcptn_IdGenerator")
    @Column(name = "PARTICIPATION_ID", nullable = false)    private Long participationId;
    
    
//    @Id
//    @Column(name = "ROLE_VERSION_NUM", nullable = false, insertable = false, updatable = false)    private Long roleVersionNum;
//    @Id
//    @Column(name = "ACT_VERSION_NUM", nullable = false, insertable = false,  updatable = false)    private Long actVersionNum;    

    
    
    @Column(name = "TYPE_CODE")    
    private String typeCode;
    
    @Column(name = "SEQUENCE_NUM")
    private Long sequenceNum;
    
    @Column(name = "STATUS_CODE")
    private String statusCode;
    
    @Column(name = "SIGNATURE_CODE_ETS_ID")
    protected String signatureCodeEtsId;
    
    //被controlact维护
    @ManyToOne
    @JoinColumns( { @JoinColumn(name = "CNTRL_ACT_ID",referencedColumnName = "ACT_ID"),
                    @JoinColumn(name = "CNTRL_ACT_VERSION_NUM", referencedColumnName = "ACT_VERSION_NUM")
                    } )
    private RimCoreActs controlAct;

    @ManyToOne
    @JoinColumns( { @JoinColumn(name = "ACT_ID", referencedColumnName = "ACT_ID"), 
                    @JoinColumn(name = "ACT_VERSION_NUM", referencedColumnName = "ACT_VERSION_NUM")
                    } )
    private RimCoreActs participationAct;

    @ManyToOne
    @JoinColumns( { @JoinColumn(name = "ROLE_ID",referencedColumnName = "ROLE_ID"), 
                    @JoinColumn(name = "ROLE_VERSION_NUM", referencedColumnName = "ROLE_VERSION_NUM")
                    } )
    private RimCoreRoles roleParticipation;
    
    //@ManyToOne(cascade = CascadeType.ALL)
    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "NOTE_TEXT_ED_ID", referencedColumnName = "ED_ID")    
    private RimCoreEds rimCoreEdsNoteTextEdId = new RimCoreEds();
    
	//@ManyToOne(cascade = CascadeType.ALL)
    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "SIGNATURE_TEXT_ED_ID", referencedColumnName = "ED_ID")    
    private RimCoreEds rimCoreEdsSignatureTextEdId = new RimCoreEds();    
     
    
    public RimCoreActPrtcptns() {
    }
    
	public RimCoreRoles getRoleParticipation() {
		return roleParticipation;
	}

	public void setRoleParticipation(RimCoreRoles roleParticipation) {
		this.roleParticipation = roleParticipation;
	}

	protected RimCoreEds getRimCoreEdsNoteTextEdId() {
		return rimCoreEdsNoteTextEdId;
	}

	protected void setRimCoreEdsNoteTextEdId(RimCoreEds rimCoreEdsNoteTextEdId) {
		this.rimCoreEdsNoteTextEdId = rimCoreEdsNoteTextEdId;
	}

	protected RimCoreEds getRimCoreEdsSignatureTextEdId() {
		return rimCoreEdsSignatureTextEdId;
	}

	protected void setRimCoreEdsSignatureTextEdId(
			RimCoreEds rimCoreEdsSignatureTextEdId) {
		this.rimCoreEdsSignatureTextEdId = rimCoreEdsSignatureTextEdId;
	}

    
//    public Long getActVersionNum() {
//        return actVersionNum;
//    }
//
//    public void setActVersionNum(Long actVersionNum) {
//        this.actVersionNum = actVersionNum;
//    }

    public Long getParticipationId() {
        return participationId;
    }

    public void setParticipationId(Long participationId) {
        this.participationId = participationId;
    }

//    public Long getRoleVersionNum() {
//        return roleVersionNum;
//    }
//
//    public void setRoleVersionNum(Long roleVersionNum) {
//        this.roleVersionNum = roleVersionNum;
//    }

    public RimCoreActs getParticipationAct() {
        return participationAct;
    }

    public void setParticipationAct(RimCoreActs participationAct) {
        this.participationAct = participationAct;
    }

    public RimCoreRoles getRoleparticipation() {
        return roleParticipation;
    }

    public void setRoleparticipation(RimCoreRoles Roleparticipation) {
        this.roleParticipation = Roleparticipation;
    }

    public void setControlAct(RimCoreActs controlAct) {
        this.controlAct = controlAct;
    }

    public RimCoreActs getControlAct() {
        return controlAct;
    }

    public String getTypeCode()
    {
        return typeCode;
    }

    public void setTypeCode(String typeCode)
    {
        this.typeCode = typeCode;
    }    
    
    public Long getSequenceNum()
    {
        return sequenceNum;
    }


    public void setSequenceNum(Long sequenceNum)
    {
        this.sequenceNum = sequenceNum;
    }

    public void setStatusCode(String statusCode)
    {
        this.statusCode = statusCode;
    }

    public String getStatusCode()
    {
        return statusCode;
    }

}
